<?xml version="1.0" encoding="UTF-8" ?>
<!--
File Name : attendManager.jsp
-->
<%@ page 	language="java" 	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib 	prefix="s" 			uri="/struts-tags"%>

<html 		xmlns="http://www.w3.org/1999/xhtml">
<!-- ============================== BODY START ==============================-->
<head>
	<s:head theme="ajax" />
	<meta http-equiv="Content-Type" 	content="text/html; charset=UTF-8" />
	<meta http-equiv="pragma" 			content="no-cache" />
	<meta http-equiv="cache-control" 	content="no-cache" />
	<meta http-equiv="expires" 			content="0" />

	<title>근태관리확인-관리자</title>
	<link rel="stylesheet" type="text/css" href="/inc/css/common.css" />
	<link rel="stylesheet" type="text/css" href="/inc/css/dhtmlxcalendar.css" />
	
	<script type="text/javascript" src="/inc/js/common.js"></script>
	<script type="text/javascript" src="/js/common.js"></script>
	<script type="text/javascript" src="/js/dhtmlXCommon.js"></script>
	<script type="text/javascript" src="/js/dhtmlxcalendar.js"></script>
	
	<!-- ============================== J A V A S C R I P T		S T  A R T ============================== -->
	<script type="text/javascript">

	/*********************************************CALENDER******************************************************/
	/////////////////////달력////////////////////////////////////////////////
	function doOnLoad()
	{
		// 달력
		cal1 = new dhtmlxCalendarObject('s_date', false, {isYearEditable: true , isMonthEditable: true});
		cal1.setYearsRange(2000, 2050);
		cal1.setPosition(20,-82);
		cal1.draw();
		cal1.setOnClickHandler(selectDate1);

		cal2 = new dhtmlxCalendarObject('e_date', false, {isYearEditable: true , isMonthEditable: true});
		cal2.setYearsRange(2000, 2050);
		cal2.setPosition(20,-82);
		cal2.draw();
		// cal2.setOnClickHandler(selectDate2);

		document.getElementById('s_date').onfocus = function() { if (cal2.isVisible()) cal2.hide(); }
		document.getElementById('s_date').onfocus = function() { if (cal1.isVisible()) cal1.hide(); }

		document.body.onclick = function(){calendarHide("cal1,cal2","D");};
	}

	function selectDate1(date)
	{
		document.getElementById('s_date').value = cal1.getFormatedDate(null,date);
		dateFrom = new Date(date);
		dateTo = null;
		cal2.setSensitive(dateFrom, dateTo);
		cal1.hide();
		return true;
	}

	function selectDate2(date)
	{
		document.getElementById('e_date').value = cal1.getFormatedDate(null,date);
		dateTo = new Date(date);
		dateFrom = null;
		cal1.setSensitive(dateFrom, dateTo);
		cal2.hide();
		return true;
	}
	/////////////////////달력////////////////////////////////////////////////

	/*********************************************CALENDER******************************************************/

		//체크한 값을 넘기기 위한 전역변수
		var index 	= 	0;
		var args	=	"";
		/*************************************************************************************************/
		//엑셀다운로드
		function fnc_excel() {
			
			var f = document.frm;
			
			f.action = "attendManegerExcel.action";		//att_struts.xml
			f.submit();
			
			return false;		//페이지 로딩을 없게 한다.
		}
		/*************************************************************************************************/
		
		/*************************************************************************************************/
		//조회버튼 클릭시 실행됨.
		function fnc_retrieve() {
			call_dojo();
			return false;
		}
		/*************************************************************************************************/
		
		/*************************************************************************************************/
		//ajax로 조회리스트 호출.
	    function call_dojo() {
	        dojo.event.topic.publish("ajax_list");
	        return false;
	    }
		/*************************************************************************************************/
	    
		/*************************************************************************************************/
	    /**
	    *그룹선택이 변경될 경우에 팀과 사원  list를 변경한다.
	    */
	    function selectChange(type) {
	    
	    	if (type == "group") {
				dojo.event.topic.publish("show_team");	//팀
				dojo.event.topic.publish("show_emp");	//사원
	    	} else if (type == "team") {
				dojo.event.topic.publish("show_emp");	//사원
	    	}

			return false;
		}
/*		function selectChange(type) {
		    
	    	if (type == "group") {
	    		$("#sgroup").css({backgroundColor:'#3366FF', color:'#FFFFFF'});
	    		if($("#sgroup").val()=="ALL"){
	    			$("#sgroup").css({backgroundColor:'#ffffff',color:'#656464'});
		        }
				dojo.event.topic.publish("show_team");	//팀
				
				dojo.event.topic.publish("show_emp");	//사원
	    	} else if (type == "team") {
	    		$("#steam").css({backgroundColor:'#3366FF', color:'#FFFFFF'});
	    		if($("#steam").val()=="ALL"){
	    			$("#steam").css({backgroundColor:'#ffffff', color:'#656464'});
		        }
				dojo.event.topic.publish("show_emp");	//사원
	    	}

			return false;
		} */
		
		/*************************************************************************************************/
		
		/*************************************************************************************************/
		//확인 버튼 클릭
		function fnc_ok(f) {
		
			var flag = false;	//체크유무
		
			var cnt = 0;		//갯수 초기화
			
			
			//체크박스가 없을 떄
			if(typeof document.frm2.s_chk == "undefined" ){
				alert("조회된 데이터가 없습니다.");
				return false;
			}
			
			var f2	=	document.frm2;
			

			//체크박스가 1개인 경우
			if(typeof f2.s_chk.length == "undefined" ){
 
				if (!f2.s_chk.checked) {
					alert("미입력은 체크가 자동 해제됩니다. <s:text name="alert.message.notCheck" />");//체크할 대이터가 없음.
					f2.s_chk.focus();
					return false;
				} else if ( f2.ori_in_out_detail.value != f2.in_out_detail.value 
						&&	//변경한 경우와 비고가 공백인지 확인함. 
						f2.etc_mgr.value.replace(/^\s\s*/, '').replace(/\s\s*$/, '').length == 0) {					
					alert("<s:text name="alert.message.confirm" />");	//확인자비고를 반드시 입력하시기 바랍니다.
					f2.etc_mgr.focus();
					return false;					
				}else{
					cnt = 1;
				}
								
			} else {
				//체크박스가 1개 이상이면
				flag = true;
				
				for (var i = 0 ; i < f2.s_chk.length ; i++) {
					if (f2.in_out_detail[i].value == "XX") {
						//alert("미입력이 입력된 행이 체크되어있습니다. \n\n 미입력 행을 제외하고 저장합니다.");
						f2.s_chk[i].checked = false;
					}
					
					//flag=true;
					if (f2.s_chk[i].checked) {
						//확인자 비고 미입력 확인 trim 적용
						if ( f2.ori_in_out_detail[i].value != f2.in_out_detail[i].value 
								&& 
								f2.etc_mgr[i].value.replace(/^\s\s*/, '').replace(/\s\s*$/, '').length == 0) {
							alert("<s:text name="alert.message.confirm" />");
							f2.etc_mgr[i].focus();
							return false;
						
						}else{
							cnt++;
						}		
					}
				}//for

			}
			
			if(cnt == 0){
				alert("<s:text name="alert.message.notCheck" />");
				return false;
			}

			if (confirm("<s:text name="alert.message.confirmCheck" />")) {
				var args = fnc_arrMetrix();
				
				f2.updateArgs.value = args;	//update 할 arguments 전달
				
				document.getElementById("ajaxFlag").value = "Y";
				
				dojo.event.topic.publish("ajaxDojo");

				return false;
			}
			
			return false;
		}
		/*************************************************************************************************/
		
		//체크된 값들만 모아 배열 메트릭스 구성
		
		function fnc_arrMetrix() {

			//1개일경우
			if (frm2.s_chk.length == undefined ) {
				if (frm2.s_chk.checked) {
					//초기화
					args = 	new Array();	//배열생성

					var arr = new Array();
					
					//pk
					arr.push(	frm2.yyyymmdd.value		);
					arr.push(	frm2.aemp_no.value		);
					arr.push(	frm2.in_out_tp.value		);
					//pk
					
					arr.push(	frm2.in_out_detail.value	);
					
					if (frm2.etc_mgr.length == 0) {
						frm2.etc_mgr.value = "";
					}
					arr.push(	frm2.etc_mgr.value		);
					
					args.push( arr );
				}
				
			} else {	//다수일 경우
				//초기화
				args = 	new Array();	//배열생성
				
				for (var i = 0 ; i < frm2.s_chk.length ; i++ ) {
					
					if ( frm2.s_chk[i].checked ) {

						var arr	=	new Array();
					
						//arr.push(	frm2.s_chk[i].value			);
	
						//pk
						arr.push(	frm2.yyyymmdd[i].value		);
						arr.push(	frm2.aemp_no[i].value		);
						arr.push(	frm2.in_out_tp[i].value		);
						//pk
						
						arr.push(	frm2.in_out_detail[i].value	);
						arr.push(	frm2.etc_mgr[i].value		);
						arr.push(	frm2.advantage[i].value		);
						
						args.push( arr );
	
					}	//if
					
				}	//for
			}

			return args;
		}	//fnc_arrMetrix end.........

		
		/*******************************************
//		var holidayCheckIn	=	"0006";	//공휴일출근
//		var holidayCheckOut	=	"1008"	//공휴일퇴근
//		var holiday			=	"8003"	//공휴일
			
//		var annual			=	"2001";	//연차휴가
//		var	special			=	"2002"	//특별휴가
//		var happen			=	"2003";	//경조휴가
//		var official 		=	"2004"	//공가휴가
			
		var NN 				=	"NN"	//결근
		var XX		 		=	"XX"	//미입력

		//--------------------------------
		//Add on
		 
//		var	ok_in		=	"0001"	//정상출근
//		var	late_in		=	"0002"	//지각
//		var area_in		=	"0003"	//정상출근(현지)
//		var	even_vaca	=	"0004"	//오전휴가
//		var	even_pub	=	"0005"	//오전공가

//		var	ok_out		=	"1001"	//정상퇴근
//		var	area_out	=	"1002"	//정상퇴근(현지)
//		var	even_out	=	"1003"	//조퇴
//		var	night_work	=	"1004"	//야근
//		var	all_work	=	"1005"	//철야
//		var	after_vaca	=	"1006"	//오후휴가
//		var	after_pub	=	"1007"	//오후공가
				
		*******************************************/
		
		/***************************************************************************************************************/
		//출근유형
		function fnc_dailyInSelect(sel) {

			removeAllOptions(sel);	//All Remove.
			
			<s:iterator value="dailyInList">
				addOption(sel , "<s:property value="cd" />" , "<s:property value="cd_nm" />" );	//Option Append.
			</s:iterator>
		}
		/***************************************************************************************************************/
	
		//퇴근유형
		function fnc_dailyOutSelect(sel) {

			removeAllOptions(sel);	//All Remove.
			
			<s:iterator value="dailyOutList">
				addOption(sel , "<s:property value="cd" />" , "<s:property value="cd_nm" />" );	//Option Append.
			</s:iterator>
		}
		/***************************************************************************************************************/
		//fnc_selected : 본 Script 수정시 Script과 DAO단과  Query단을 수정해야함.
		
		/**
			v : 현재 선택하는 출근 select
			seq : table row index
			flag : change || outloop
		*/
		
		function fnc_selected(v , seq , flag) {
			
			if (flag == "change") {

				var yyyymmdd	=	frm2.yyyymmdd[seq].value;
				var in_out_tp	=	frm2.in_out_tp[seq].value;
				var emp_no		=	frm2.aemp_no[seq].value;

				//본래값과 같을 경우 체크를 해제한다.
				if (v.value == frm2.ori_in_out_detail[seq].value) {
					frm2.s_chk[seq].checked = false;
				} else {
					frm2.s_chk[seq].checked = true;
				}

				//출_퇴근_유형
				for (var i = 0 ; i < frm2.in_out_detail.length ; i++) {
					
					var i_yyyymmdd	=	frm2.yyyymmdd[i].value;		//기준날짜
					var i_in_out_tp	=	frm2.in_out_tp[i].value;	//출퇴근 타입
					var i_emp_no	=	frm2.aemp_no[i].value;		//사번

					if (i != seq) {
						//기준일자 && 사번 비교
						if ( yyyymmdd == i_yyyymmdd && emp_no == i_emp_no ) {
							//frm2.in_out_detail[i].disabled 	= 	false;	//퇴근활성화
							var detail = frm2.in_out_detail[seq].value;

							if (frm2.in_out_tp[i].value == "O") {
								//퇴근 목록 변경
								fnc_optionChange( frm2.in_out_detail[i] , "I" , v.value , frm2.in_out_tp_nm[i].value , i );
							}	//if
						}	//if
					}	//if
				}	//	for

			} else if (flag == "outloop") {

				for ( var i = 0; i < frm2.in_out_detail.length; i++) {
					
					var i_yyyymmdd	=	frm2.yyyymmdd[i].value;		//기준날짜
					var i_in_out_tp	=	frm2.in_out_tp[i].value;	//출퇴근 타입
					var i_emp_no	=	frm2.aemp_no[i].value;		//사번

					if (i != seq) {
						//기준일짜 //사번 비교
						if (yyyymmdd == i_yyyymmdd && emp_no == i_emp_no) {
							frm2.in_out_detail[i].disabled 	= 	false;	//퇴근활성화
							
						}
					}	//if
				}	//for
			}	//else if
		}
		

		//option 전체 제거
		function removeAllOptions(selectbox)
		{
			var i;
			
			for(i = selectbox.options.length-1 ; i>=0 ; i--)
			{
				selectbox.remove(i);
			}
		}

		//Option 추가.
		function addOption(selectbox , value , text , i )
		{
			var optn 	= document.createElement("OPTION");

			optn.text 	= text;
			optn.value 	= value;

			//alert("selectbox   :   " + selectbox.value+"\nvalue  :  "+value +"\ntext  :  " +text+"\n")

			if (value == frm2.ori_in_out_detail[i].value) {
				var attr = document.createAttribute("selected");
				attr.nodeValue = "selected";
				
				optn.setAttributeNode(attr);
			}
			
			selectbox.options.add(optn);
		}


		//select 동적 생성
		function addOptionDyna(selectbox , value , text) {
			
			var optn 	= document.createElement("OPTION");

			optn.text 	= text;
			optn.value 	= value;

			selectbox.options.add(optn);
		}

		//
		function removeOptions(selectbox)
		{
			var i;
			
			for(i = selectbox.options.length - 1 ; i >= 0 ; i--)
			{
				var opt = selectbox.options[i];		//선택된 value

				//alert(opt.value)

				if(selectbox.options[i].selected)
					selectbox.remove(i);
			}
		}

		//퇴근 셀렉트 비활성화시에 메시지 출력
		function fnc_attend_out_msg(th) {
			
			if (th.disabled == true) {
				alert("출근유형 변경시 활성화 됩니다.");
			}
			return false;
		}


		//전체선택 /해제
		function fnc_selectAll(f) {
			if(typeof frm2.s_chk != "undefined" ){
				if(typeof frm2.s_chk.length != "undefined"){
					if ( f.selectALL.checked ) {
						
						alert("출\/퇴근유형 \'미입력\'인 경우는 체크가 되지 않습니다.");
						for ( var i = 0 ; i < frm2.s_chk.length ; i++ ) {
							//미입력일경우 건너뜀
							if (frm2.in_out_detail[i].value == "XX") {
								continue;
							}
							
							if (!frm2.s_chk[i].disabled) {
								frm2.s_chk[i].checked = true;
							}							 
						}						
					} else {						 
						for ( var i = 0 ; i < frm2.s_chk.length ; i++ )  frm2.s_chk[i].checked = false;
					}			
				}else{
					if ( f.selectALL.checked ) {
								frm2.s_chk.checked = true;
					} else {						 
						frm2.s_chk.checked = false;
					}	
				}
			} else {
				if(f.selectALL.checked){
					alert("체크할 데이타가 없습니다.");
				}
			}
		}

		function fnc_mod_io_detail(r) {
			//alert(r)
			if (confirm("수정하시겠습니까?") ) {
				document.getElementById("in_out_detail")[r].disabled = false;
			} else {
				document.getElementById("in_out_detail")[r].disabled = true;
			}
		}

		/**
		출근  / 퇴근 상세 Pop-Up
		*/
		function fnc_in_out_detail(digit) {
			
			//alert(digit); return false;
			
			var yyyymmdd 	= "";		//기준일자		//PK
			var emp_no	 	= 0;		//사번			//PK
			var in_out_tp 	= "";		//출퇴근 유형 		//PK
			
			if (frm2 == undefined) {
				alert("데이터가 없습니다.");
				return false;
			} else if (frm2.s_chk == undefined) {
				alert("데이터가 없습니다.");
				return false;
			} else if (frm2.s_chk.length == undefined) {	//데이터가 1row인 경우

				yyyymmdd	=	frm2.yyyymmdd.value;
				in_out_tp  	= 	frm2.in_out_tp.value;
				emp_no		=	frm2.aemp_no.value;

				//alert(yyyymmdd +"\n"+in_out_tp+"\n"+emp_no);
				
			} else {
				yyyymmdd	=	frm2.yyyymmdd[digit].value;
				in_out_tp  	= 	frm2.in_out_tp[digit].value;
				emp_no		=	frm2.aemp_no[digit].value;

				//alert(yyyymmdd +"\n"+in_out_tp+"\n"+emp_no);

			}

			var w = 350;
			var h = 452;
			
			var x = fnc_center_x(w);
			var y = fnc_center_y(h);

			var url 	= 	"attendManeger_detail_p.action";
			var nm 		= 	"detail";
			var attr 	= 	"width=" + w + " , height=" + h + " , top=" + y + " , left=" + x + " , status=no";   //window size
			
			var param	=	"one_yyyymmdd=" + yyyymmdd + "&";
				param	+= 	"emp_no=" 		+ emp_no + "&";
				param	+=	"in_out_type=" 	+ in_out_tp;

				url		+=	"?" + param;

			window.open(url , nm , attr);

			return false;
		}//fnc_in_out_detail()
		
		//
		function fnc_chioce(th , idx) {

			//본래의 값으로 돌아오면 체크해제함.
			if ((th.value == frm2.ori_in_out_detail[idx].value) ) {
				frm2.s_chk[idx].checked = false;
			} else if (th.value == "XX") {	//미입력
				frm2.s_chk[idx].checked = false;
			} else {
				frm2.s_chk[idx].checked = true;
			}

			var yyyymmdd 		= 	frm2.yyyymmdd[idx].value;
			var emp_no			=	frm2.aemp_no[idx].value;
			var in_out_detail	=	frm2.in_out_detail[idx].value;

			//
			for ( var i = 0; i < frm2.s_chk.length; i++) {

				if (i != idx) {
					var tar		=	frm2.in_out_detail[i];

					if ((yyyymmdd == frm2.yyyymmdd[i].value) && (emp_no == frm2.aemp_no[i].value) && ( frm2.in_out_tp[i].value == "O") ) {
					//alert(yyyymmdd +"\n"+ emp_no +"\n"+ in_out_detail)
						//오전휴가  오후휴가
						if (tar.value == "1006" &&  th.value == "0004") {
					
							alert("오전휴가와 오후휴가는 같이 적용할 수 없습니다.");
	
							th.value = frm2.ori_in_out_detail[idx].value;
							tar.value = frm2.ori_in_out_detail[i].value;
	
							return false;
						//오전공가 오후공가
						} else if (tar.value == "1007" &&  th.value == "0005") {
	
							alert("오전공가와 오후공가는 같이 적용할 수 없습니다.");
	
							th.value 	= frm2.ori_in_out_detail[idx].value;
							tar.value 	= frm2.ori_in_out_detail[i].value;
	
							return false;
						}

						/* --20090508 fix..
						if (th.value != "0006" && th.value != "8003") {
							removeAllOptions(tar);
						}
						*/
						removeAllOptions(tar);
							
						if (th.value == "0001" || th.value == "0002" || th.value == "0003") {
							<s:iterator value="list_0001">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>


						} else if (th.value == "0004") {
							<s:iterator value="list_0004">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>
							
							
						} else if (th.value == "0005") {
							<s:iterator value="list_0005">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>

							
						} else if (th.value == "XX") {//미입력
							<s:iterator value="list_XX">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>
							
							
						} else if (th.value == "NN") {//결근
							<s:iterator value="list_NN">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>
							
						} else if (th.value == "2001") {//연차
							<s:iterator value="list_2001">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>

							
						} else if (th.value == "2002") {//특별
							<s:iterator value="list_2002">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>
								
						} else if (th.value == "2003") {//경조
							<s:iterator value="list_2003">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>

							
						} else if (th.value == "2004") {//공가

							<s:iterator value="list_2004">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>

						} else if (th.value == "2005") {//기타휴가
							<s:iterator value="list_2005">
								addOption(tar , "<s:property value="cd" />" , "<s:property value="cd_nm" />" , i );	//Option Append.
							</s:iterator>
						//평일-공휴일일 경우 --20090508--
						} else if (th.value == "0006" || th.value == "8003" ) {//공휴일출근
							addOption(tar , "1008" , "공휴일퇴근" , i );	//Option Append.
							addOption(tar , "8003" , "공휴일퇴근" , i );	//Option Append.
							addOption(tar , "NN"   , "미입력" 	, i );	//Option Append.
						}
						
						break;

					}
				}
			}
			
		}
		
		//////////////////////////////////////////////
		function setOtion_buseo( obj , idx , arr) {

			//removeAllOptions(obj);

			if (typeof obj == "undefined") {
				alert("데이터가 없습니다.");
				return false;
			}
			
			var objOptionValue = obj.options[obj.options.selectedIndex].value;
			
			if( obj.options.selectedIndex != 0 ){

				var buseo_baleui = document.frm2.in_out_detail[idx];
				
				for(var j = buseo_baleui.length; j > 0 ; j--){
					buseo_baleui.options[j] = null;
				}

				for( var i = 0, z = 0 ; i < arr.length ; i++ ){
					if( objOptionValue == arr[i].alt ) {
						buseo_baleui.options[z] = arr[i];
						z++;
					}	//	if
				}	//	for
			}
		}	//fnc_chioce


	  	//popup 정가운데 띄우기
		function fnc_center_x(w) {

	       	var x;
	       	
			x =  (screen.availWidth - w) / 2;

	       	return x;
		}

	  	//popup 정가운데 띄우기
		function fnc_center_y(h) {

	       	var y;
	       	
			y =  (screen.availHeight - h) / 2;

	       	return y;
		}

		//확인여부에서 N인 경우 데이터가 없을 때
		function fnc_confirm_yn() {
		}

		function fnc_search() {
			var s_date = parseInt( frm.s_date.value.replace("-" , "") , 10 );
			var e_date = parseInt( frm.e_date.value.replace("-" , "") , 10 );
			
			if ( s_date > e_date ) {
				alert("조회기간이 잘못되었습니다. \n\n시작일자을 다시 확인하시기 바랍니다.");
			} else {
				getList('search');
			}
			return false;
			
		}

		/****
		20091007
		*/
		function fnc_disabled() {
	    	if (document.frm.searchEmpNm.value.length > 0) {
	    		$("#semp_no").attr("disabled" , "disabled");
	    	}
		}


		/***************************************C O O K I E****************************************************/
		//쿠키-하루동안 안보기
		function setCookie(name, value, expiredays)
		{
		    // 만료일 (expiredays가 365면 만료일은 현재날짜로부터 365일)
		    var exdate = new Date();
		    exdate.setDate(exdate.getDate()+expiredays);

		    document.cookie = name+"="+value+((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
		}

		function getCookie( name )
		{
		    var nameOfCookie = name + "=";
		    var x = 0;
		    while ( x <= document.cookie.length )
		    {
		        var y = (x+nameOfCookie.length);
		        if ( document.cookie.substring( x, y ) == nameOfCookie ) {
		            if ( (endOfCookie=document.cookie.indexOf( ";", y )) == -1 )
		                endOfCookie = document.cookie.length;
		            return unescape( document.cookie.substring( y, endOfCookie ) );
		        }
		        x = document.cookie.indexOf( " ", x ) + 1;
		        if ( x == 0 )
		            break;
		    }
		    return "";
		}
		/***************************************C O O K I E****************************************************/


	</script>
	<!-- ============================== J A V A S C R I P T 	E	N	D ============================== -->
</head>
<!-- ============================== HEAD END ============================== -->

<!-- ============================== BODY START ============================== -->
<body onload="doOnLoad()">

<div id="popup_850se_top" ></div>
    <div id="popup_850se_bg">
		<div>
		
		<s:form name="frm" id="frm" theme="simple">

			<s:hidden name="emp_no" 	id="emp_no" value="%{semp_no}" 	/>
			<s:hidden name="emp_nm" 	id="emp_nm" value="%{semp_nm}"	/>
			<s:hidden name="group_no" 	id="group_no" 	/>
			<s:hidden name="group_nm" 	id="group_nm" 	/>
			<s:hidden name="team_no" 	id="team_no" value="%{steam}" 	/>
			
			<s:hidden id="cur_page" name="cur_page"/>
				<!-- -------------------------------------	C O N D I T I O N 	S T A R T------------------------------------- -->
				<div id="search01">
				<div id="search_box01">
					<ul>
						<li class="txt">기간</li>
						<li class="input">
							<!-- /////////////////////달력//////////////////////////////////////////////// -->
                              <input type="text" size="12" maxlength="10" name="s_date" id="s_date" value="<s:property value="s_date" />" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:pointer;" />
                               ~
                              <input type="text" size="12" maxlength="10" name="e_date" id="e_date" value="<s:property value="e_date" />" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:pointer;" />
                            <!-- /////////////////////달력//////////////////////////////////////////////// -->
						</li>
					</ul>
					<ul>
						<li class="txt">그룹</li>
						<li class="input">
							<s:if test='semp_no in {100 , 1}'>
								<s:select id="sgroup" 	name="sgroup" list="listGroup" cssClass="combobox100se"	listKey="group_no" listValue="group_nm" onchange="return selectChange('group')" headerKey="ALL" headerValue="::전체::" />
							</s:if>
							<s:else>
								<s:select id="sgroup" 	name="sgroup" list="listGroup" cssClass="combobox100se"	listKey="group_no" listValue="group_nm" onchange="return selectChange('group')" />
							</s:else>
						</li>
						<li class="txt00">팀</li>
						<li class="input">
							<s:url id="team_url" action="myVacaSelectTeam_s" />
							<s:div showLoadingText="false" id="team_div" href="%{team_url}" theme="ajax" listenTopics="show_team" formId="frm"/>
						</li>
						<li class="txt00">확인여부</li>
						<li class="input">
							<s:select id="confirm_yn" 		name="confirm_yn" 		list="#{'Y':'Y' , 'N':'N'}" cssClass="combobox100se" headerKey="ALL" headerValue="::전체::" />
						</li>
						<li class="txt00">출/퇴근<br/>분류</li>
						<li class="input">
							<s:select id="in_out_tp_condi" name="in_out_tp_condi" list="#{'I':'출근' , 'O':'퇴근'}" cssClass="combobox100se" headerKey="ALL" headerValue="::전체::" />
						</li>
					</ul>
					<!-- -------------------------------------	C O N D I T I O N 	E	N	D------------------------------------- -->
					<!-- -------------------------------------	B U T T O N 	S T A R T------------------------------------- -->
					<ul>
						<li>
						<span class="fl_ri">
							<s:submit type='image' src="/images/btn_search03.gif" 	cssClass="img_tm" onclick="return fnc_search()" />&nbsp;
							<s:submit type='image' src="/images/btn_excel.gif" 		cssClass="img_tm" title="EXCEL 다운로드" value="EXCEL 다운로드" onclick="return fnc_excel()" />
							<!--<img src="/images/search_dot_line.gif" />-->
						</span>
						</li>
					</ul>
				</div>
			</div>
			<!----------Search_Box : ENd ---------->
			<!----------Tbl_info & Table box ------>
			<!-- -------------------------------------	B U T T O N 	E	N	D------------------------------------- -->
		</s:form>
		
		<s:form name="frm2" id="frm2" theme="simple">
			<s:hidden id="updateArgs" name="updateArgs"/>
			<s:hidden name="ajaxFlag" /><!-- 확인버튼 클릭시 전체 리플러쉬 없앰 -->

			<!-- ajax로 데이터를 조회해 온다. -->
			<s:url id="ajax_list"  action="attend_manager_list_ajax_p" />
			<s:div id="itemAmtlistDiv" theme="ajax" executeScripts="true" showLoadingText="true" loadingText='<img src="./images/loading_request.gif" />' href="%{ajax_list}" listenTopics="ajax_list" formId="frm" />
		</s:form>
		
		</div>
		</div>
		
</body>
<!-- ============================== BODY END ============================== -->

</html>